How to use Javascript to build real project

What is Javascript?

For most of the people, they may think JavaScript is nothing but a browser language, yes, but furthermore, it can be a common purpose programming language too.

So how do I use it?

1. run it at a browser

open your browser like firefox or chrome, press F12, you shell see a debug window. Click Console, you will see a terminal-like layout, yes, that's it, you can run basic Javascript codes in it.

2. we do it locally. (Actually writing it at local)

  1. you shell know what is npm and what is yarn. Basically, they do the same things. But yarn is a newer tool for managing Javascript packages
  2. let’s creat a Javascript project first.

3. import and compile

after downloaded your packages(like yarn or npm would do), if you want to run your JavaScript codes, you have to import your package, and in the end, compile your codes to the native codes that every browser can run. So this time, we have to use a new tool, parcel

4. see, what if we want to add a new package to this project, what we should do now?

5. and, what if I want to get a single static website, which can run in any browser without the yarn, parcel tools, what I should do?

Beyond all of these, is endless packages and their own special usage, like react, vue